<template>
	<view style=" padding: 30rpx;">
		<button @click="onSetTimeOut()" type="primary">单次计时器</button>
		<button @click="onSetTimeOut('jqw',666)" type="primary">启动传参计时器</button>
		<button @click="onClearTimeOut()" type="warn">取消计时器</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			onSetTimeOut(){
				console.log("onStTimeOut()");
				// setimeout(callback,ms,args)
				setTimeout(()=>{
					console.log("onSetTimeOut() callback");
					// ...
					console.log("onSetTimeOut() callback end");
				},3000);
			},
			onSetTimeOut(username,pwd){
				console.log("onStTimeOut()",username,pwd);
				// ()=>{ }
				setTimeout((x,y)=>{
					console.log("------callbck",x,y);
				},2000,username,pwd);
				onClearTimeOut(){
					clearTimeout(){
						console.error("onClearTimeOut() 取消计时器");
						clearTimeout(this.)
					}
				}
			}
		}
	}
</script>

<style>
button{
	margin: 20rpx;
}
</style>
